<?php

function openDB($host, $user, $pass, $name) {

    $connection = mysql_pconnect($host,$user,$pass);

    if ($connection) {	

	if (mysql_select_db($name)) {
	    $result = true;
	} else {
            $result = false;
	}
    } else {
        $result = false;
    }
    
    return $result;
}



if (!isset($_REQUEST['page'])) {
    $_REQUEST['page'] = 0;
}

if (!openDB("localhost", "root", "nonlaso", "hairstyle")) {
     setcontents::setTemplate();
     setcontents::setMenu("Errore di connessione al database. Ci scusiamo per il disagio","alert");
     setcontents::setBody(null);
     $main->close();
     exit;

}

?>